package company_tencent.f;

import java.util.Scanner;

public class T3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s = sc.nextInt();
        double res = 1;
        if (n == s) {
            res = 1;
        } else if (n < s) {
            res = 0;
        } else {
            int nms = n - s;
            while (n > nms) {
                res *= n;
                n--;
            }
            while (s > 0) {
                res /= s;
                s--;
            }
            res *= Math.pow(2, nms);
            res = res % (1e9 + 7);
        }
        System.out.println((int)res);
    }
}
